/*
 * Copyright (c) 2011 Jean-Marc Perronne
 * Ensisa, 12 rue des Freres Lumieres, F-68093 Mulhouse cedex
 * All rights reserved.
 *
 * The copyright of this software is owned by Werner Randelshofer. 
 * You may not use, copy or modify this software, except in  
 * accordance with the license agreement you entered into with  
 * Jean-Marc Perronne. For details see accompanying license terms. 
 */

package fr.uha.ensisa.jmp.drone.at_commands;

public class AtAnimCommand extends AbstractAtCommand
{
	public static enum AnimType {
		ANIM_PHI_M30_DEG (0),
		ANIM_PHI_30_DEG (1),	
		ANIM_THETA_M30_DEG (2),
		ANIM_THETA_30_DEG (3),
		ANIM_THETA_20DEG_YAW_200DEG (4),
		ANIM_THETA_20DEG_YAW_M200DEG (5),
		ANIM_TURNAROUND (6),
		ANIM_TURNAROUND_GODOWN (7),
		ANIM_YAW_SHAKE (8);

		private int value;
	
		AnimType(int value) {this.value=value;}
		public int value() {return this.value;}

		} ;

		private AnimType animation;
		private int timeout;

		public AtAnimCommand()
		{
			super("ANIM");
			this.animation = AnimType.ANIM_PHI_M30_DEG;
			this.timeout = 0;
		}

		public void param(AnimType animation, int timeout)
		{
			this.unReady();
			this.animation = animation;
			this.timeout = timeout;
		}

		public AnimType animation()
		{
			return this.animation;
		}

		public int timeout()
		{
			return this.timeout;
		}

		@Override
		protected void appendParamaters(StringBuilder builder)
		{
			builder.append(',').append(this.animation.value());
			builder.append(',').append(this.timeout);
		}

	}
